//
// Created by hamlet on 2021/12/29.
//

#ifndef TIANQI_TIANQIDATA_H
#define TIANQI_TIANQIDATA_H

#include <QDebug>

enum class TianqiMethod {
    Hefeng,
    TianqiServer
};

struct MethodHefeng {
    QString key;
    QString location;
};

struct MethodTianqiServer {
    QString webAddress;
};

struct TianqiData {
    int temp;
    QString text;
    QString icon;
    int aqi;
    QString category;
};

Q_DECLARE_METATYPE(TianqiMethod);
Q_DECLARE_METATYPE(MethodHefeng);
Q_DECLARE_METATYPE(MethodTianqiServer);

QDataStream& operator<<(QDataStream &out, const TianqiMethod &method);
QDataStream& operator>>(QDataStream &in, TianqiMethod &method);

QDataStream& operator<<(QDataStream &out, const MethodHefeng &hefeng);
QDataStream& operator>>(QDataStream &in, MethodHefeng &hefeng);

QDataStream& operator<<(QDataStream &out, const MethodTianqiServer &tianqiServer);
QDataStream& operator>>(QDataStream &in, MethodTianqiServer &tianqiServer);

QDebug operator<<(QDebug dbg, const TianqiMethod &method);
QDebug operator<<(QDebug dbg, const MethodHefeng &hefeng);
QDebug operator<<(QDebug dbg, const MethodTianqiServer &tianqiServer);

#endif //TIANQI_TIANQIDATA_H
